package com.syq.play.util;

import java.util.Calendar;

public class StringUtil {
	/**
	 * 将毫秒转换为日期
	 * @param time
	 * @return
	 */
	public static String getDateFromTimeInMillis(long time){
		Calendar c=Calendar.getInstance();
		c.setTimeInMillis(time);
		int y=c.get(Calendar.YEAR);
		int m=c.get(Calendar.MONTH);
		int d=c.get(Calendar.DAY_OF_MONTH);
		int hour=c.get(Calendar.HOUR_OF_DAY);
		int minute=c.get(Calendar.MINUTE);
		return y+"-"+(m+1)+"-"+d+" "+hour+":"+String.format("%02d", minute);
	}
}
